package com.xjgc.common.utils;

import com.sun.mail.imap.protocol.ID;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.xjgc.model.entity.general.*;
import com.xjgc.model.entity.mes.*;
/*import org.apache.commons.lang3.StringUtils;*/
import com.xjgc.model.entity.tax.ZxjTaxHangxinToSap;
import com.xjgc.model.entity.tax.ZxjTaxHangxinToSapCustoms;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.springframework.stereotype.Component;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import static com.xjgc.common.utils.JudgeUtils.judgeNullOrEmpty;

@Component
public class SapXmlUtils {

//    private <T> void createXmlItem(Element item, T entity) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
//        Class<?> aClass = Class.forName(entity.getClass().getTypeName());
//        Field[] declaredFields = aClass.getDeclaredFields();
//        for (int i =  1;i<declaredFields.length;i++) {
//            Method declaredMethod = aClass.getDeclaredMethod("get" + StringUtils.capitalize(declaredFields[i].getName()), null);
//            JsonProperty annotation = declaredFields[i].getAnnotation(JsonProperty.class);
//            Object value = declaredMethod.invoke(entity,null);
//            item.addElement(annotation.value()).setText(value== null ? "":value.toString());
//        }
//    }
//    public <T> Document cerateXml(List<T> entities) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
//        Document document = DocumentHelper.createDocument();
//        Element root = document.addElement("ROOT");
//        for (T entity:entities) {
//            Element item = root.addElement("item");
//            createXmlItem(item,entity);
//        }
//        return document;
//    }

    public String getXmlOf011(List<ZxjZsdstr011> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjZsdstr011 zxjZsdstr011 : list) {
            Element item = root.addElement("item");
            DecimalFormat df = new DecimalFormat("0.00");
            item.addElement("VBELN").setText(judgeNullOrEmpty(zxjZsdstr011.getVbeln()));
            item.addElement("HTHEAD").setText(judgeNullOrEmpty(zxjZsdstr011.getHthead()));
            item.addElement("VKGRP").setText(judgeNullOrEmpty(zxjZsdstr011.getVkgrp()));
            item.addElement("VKORG").setText(judgeNullOrEmpty(zxjZsdstr011.getVkorg()));
            item.addElement("BNAME").setText(judgeNullOrEmpty(zxjZsdstr011.getBname()));
            item.addElement("KDKG1").setText(judgeNullOrEmpty(zxjZsdstr011.getKdkg1()));
            item.addElement("KUNNR").setText(judgeNullOrEmpty(zxjZsdstr011.getKunnr()));
            item.addElement("KUNNR1").setText(judgeNullOrEmpty(zxjZsdstr011.getKunnr1()));
            item.addElement("BSTZD").setText(judgeNullOrEmpty(zxjZsdstr011.getBstzd()));
            item.addElement("AUGRU").setText(judgeNullOrEmpty(zxjZsdstr011.getAugru()));
            item.addElement("BSTNK").setText(judgeNullOrEmpty(zxjZsdstr011.getBstnk()));
            item.addElement("VTWEG").setText(judgeNullOrEmpty(zxjZsdstr011.getVtweg()));
            item.addElement("SPART").setText(judgeNullOrEmpty(zxjZsdstr011.getSpart()));
            item.addElement("KUNNR2").setText(judgeNullOrEmpty(zxjZsdstr011.getKunnr2()));
            item.addElement("Z005").setText(judgeNullOrEmpty(zxjZsdstr011.getZ005()));
            item.addElement("KUNNR3").setText(judgeNullOrEmpty(zxjZsdstr011.getKunnr3()));
            item.addElement("KUNNR4").setText(judgeNullOrEmpty(zxjZsdstr011.getKunnr4()));
            item.addElement("AUART").setText(judgeNullOrEmpty(zxjZsdstr011.getAuart()));
            item.addElement("VKBUR").setText(judgeNullOrEmpty(zxjZsdstr011.getVkbur()));
            item.addElement("BZIRK").setText(judgeNullOrEmpty(zxjZsdstr011.getBzirk()));

            item.addElement("BSTDK").setText(judgeNullOrEmpty(zxjZsdstr011.getBstdk()));
            item.addElement("VDATU").setText(judgeNullOrEmpty(zxjZsdstr011.getVdatu()));

            item.addElement("KUNNR5").setText(judgeNullOrEmpty(zxjZsdstr011.getKunnr5()));

            item.addElement("MAHDT").setText(judgeNullOrEmpty(zxjZsdstr011.getMahdt()));

            item.addElement("KVGR5").setText(judgeNullOrEmpty(zxjZsdstr011.getKvgr5()));
            item.addElement("ZQDZL").setText(judgeNullOrEmpty(zxjZsdstr011.getZqdzl()));
            item.addElement("ZQKTHF").setText(judgeNullOrEmpty(zxjZsdstr011.getZqkthf()));
            item.addElement("ZHTDZ").setText(judgeNullOrEmpty(zxjZsdstr011.getZhtdz()));
            item.addElement("ZAMT").setText("".equals(judgeNullOrEmpty(zxjZsdstr011.getZamt())) ? "" : df.format(zxjZsdstr011.getZamt()));
            item.addElement("ZTERM").setText(judgeNullOrEmpty(zxjZsdstr011.getZterm()));

            item.addElement("ZDAT_FH").setText(judgeNullOrEmpty(zxjZsdstr011.getZdatFh()));

            item.addElement("ZDAT_TY").setText(judgeNullOrEmpty(zxjZsdstr011.getZdatTy()));
            item.addElement("BSTKD_E").setText(judgeNullOrEmpty(zxjZsdstr011.getBstkdE()));
            item.addElement("KUNNR6").setText(judgeNullOrEmpty(zxjZsdstr011.getKunnr6()));

            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjZsdstr011.getDatum()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjZsdstr011.getUzeit()));

            item.addElement("ZQKYY").setText(judgeNullOrEmpty(zxjZsdstr011.getZqkyy()));
            item.addElement("ZKCYY").setText(judgeNullOrEmpty(zxjZsdstr011.getZkcyy()));
        }

        return document.asXML();
    }

    public String getXmlOf012(List<ZxjZsdstr012> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjZsdstr012 zxjZsdstr012 : list) {
            Element item = root.addElement("item");
            item.addElement("KHHEAD").setText(judgeNullOrEmpty(zxjZsdstr012.getKhhead()));
            item.addElement("KUNNR").setText(judgeNullOrEmpty(zxjZsdstr012.getKunnr()));
            item.addElement("NAME1").setText(zxjZsdstr012.getName1());
            item.addElement("BLAND").setText(judgeNullOrEmpty(zxjZsdstr012.getBland()));
            item.addElement("KTOKD").setText(judgeNullOrEmpty(zxjZsdstr012.getKtokd()));
            item.addElement("SORT1").setText(judgeNullOrEmpty(zxjZsdstr012.getSort1()));
            item.addElement("LAND1").setText(judgeNullOrEmpty(zxjZsdstr012.getLand1()));
            item.addElement("AKONT").setText(judgeNullOrEmpty(zxjZsdstr012.getAkont()));
            item.addElement("BUKRS").setText(judgeNullOrEmpty(zxjZsdstr012.getBukrs()));

            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjZsdstr012.getDatum()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjZsdstr012.getUzeit()));

        }
        return document.asXML();
    }

//    private String judgeNullOrEmpty (String value){
//        if (value == null || value.equals(null)){
//            value = "";
//        }
//        return value;
//    }

    public String getXmlOf015(List<ZxjZsdstr015> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjZsdstr015 zxjZsdstr015 : list) {
            Element item = root.addElement("item");
            item.addElement("VBELN").setText(judgeNullOrEmpty(zxjZsdstr015.getVbeln()));

            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjZsdstr015.getDatum()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjZsdstr015.getUzeit()));

            item.addElement("ZQKYY").setText(judgeNullOrEmpty(zxjZsdstr015.getZqkyy()));
        }

        return document.asXML();
    }

    public String getXmlOf016(List<ZxjZsdstr016> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjZsdstr016 zxjZsdstr016 : list) {
            Element item = root.addElement("item");
            item.addElement("VBELN").setText(zxjZsdstr016.getVbeln());
            item.addElement("TETXT").setText(zxjZsdstr016.getTetxt());
            item.addElement("ZEILE").setText(zxjZsdstr016.getZeile());
            item.addElement("FPROZ").setText(judgeNullOrEmpty(zxjZsdstr016.getFproz()));
            item.addElement("ZFKTS").setText(judgeNullOrEmpty(zxjZsdstr016.getZfkts()));
            item.addElement("ZZBLX").setText(judgeNullOrEmpty(zxjZsdstr016.getZzblx()));
            item.addElement("Z_TYPE").setText(judgeNullOrEmpty(zxjZsdstr016.getZType()));

            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjZsdstr016.getDatum()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjZsdstr016.getUzeit()));
        }
        return document.asXML();
    }

    public String getXmlOf018(List<ZxjZsdstr018> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjZsdstr018 zxjZsdstr018 : list) {
            Element item = root.addElement("item");
            DecimalFormat df = new DecimalFormat("0.00");
            item.addElement("BSSNU").setText(zxjZsdstr018.getBssnu());
            item.addElement("POSN").setText(zxjZsdstr018.getPosn());
            item.addElement("VBELN1").setText(judgeNullOrEmpty(zxjZsdstr018.getVbeln1()));
            item.addElement("VBELN3").setText(judgeNullOrEmpty(zxjZsdstr018.getVbeln3()));
            item.addElement("FRCLS").setText(judgeNullOrEmpty(zxjZsdstr018.getFrcls()));
            item.addElement("RKAMT").setText("".equals(judgeNullOrEmpty(zxjZsdstr018.getRkamt())) ? "" : df.format(zxjZsdstr018.getRkamt()));
            item.addElement("PARTNER").setText(judgeNullOrEmpty(zxjZsdstr018.getPartner()));

            item.addElement("KOSTL").setText(judgeNullOrEmpty(zxjZsdstr018.getKostl()));
            item.addElement("KDKG1").setText(judgeNullOrEmpty(zxjZsdstr018.getKdkg1()));
            item.addElement("NOTE").setText(judgeNullOrEmpty(zxjZsdstr018.getNote()));


            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjZsdstr018.getDatum()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjZsdstr018.getUzeit()));
            item.addElement("VKORG").setText(judgeNullOrEmpty(zxjZsdstr018.getVkorg()));
        }
        return document.asXML();
    }

    public String getXmlOf020(List<ZxjZsdstr020> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");

        for (ZxjZsdstr020 zxjZsdstr020 : list) {
            Element item = root.addElement("item");
            DecimalFormat df = new DecimalFormat("0.00");

            item.addElement("BUKRS").setText(judgeNullOrEmpty(zxjZsdstr020.getBukrs()));
            item.addElement("RENOTE").setText(judgeNullOrEmpty(zxjZsdstr020.getRenote()));
            item.addElement("POSNR").setText(judgeNullOrEmpty(zxjZsdstr020.getPosnr()));
            item.addElement("VKORG").setText(judgeNullOrEmpty(zxjZsdstr020.getVkorg()));
            item.addElement("RENUM").setText(judgeNullOrEmpty(zxjZsdstr020.getRenum()));
            item.addElement("REWAC").setText(judgeNullOrEmpty(zxjZsdstr020.getRewac()));
            item.addElement("HKFS").setText(judgeNullOrEmpty(zxjZsdstr020.getHkfs()));
            item.addElement("PRCTR").setText(judgeNullOrEmpty(zxjZsdstr020.getPrctr()));
            item.addElement("BDATE").setText(judgeNullOrEmpty(zxjZsdstr020.getBdate()));
            item.addElement("NAME1").setText(judgeNullOrEmpty(zxjZsdstr020.getName1()));
            item.addElement("BKAMT").setText("".equals(judgeNullOrEmpty(zxjZsdstr020.getBkamt())) ? "" : df.format(zxjZsdstr020.getBkamt()));
            item.addElement("WAERS").setText(judgeNullOrEmpty(zxjZsdstr020.getWaers()));
            item.addElement("BKDIG").setText(judgeNullOrEmpty(zxjZsdstr020.getBkdig()));
            item.addElement("KTEXT").setText(judgeNullOrEmpty(zxjZsdstr020.getKtext()));
            item.addElement("URNAM").setText(judgeNullOrEmpty(zxjZsdstr020.getUrnam()));
            item.addElement("EINRD").setText(judgeNullOrEmpty(zxjZsdstr020.getEinrd()));
            item.addElement("NOTE").setText(judgeNullOrEmpty(zxjZsdstr020.getNote()));
            item.addElement("STATUS").setText(judgeNullOrEmpty(zxjZsdstr020.getStatus()));
            item.addElement("ZCLASS").setText(judgeNullOrEmpty(zxjZsdstr020.getZclass()));
            item.addElement("SYR").setText(judgeNullOrEmpty(zxjZsdstr020.getSyr()));
            item.addElement("YJHKR").setText(judgeNullOrEmpty(zxjZsdstr020.getYjhkr()));
            item.addElement("PCM").setText(judgeNullOrEmpty(zxjZsdstr020.getPcm()));
            item.addElement("SQDY").setText(judgeNullOrEmpty(zxjZsdstr020.getSqdy()));
            item.addElement("SJDY").setText(judgeNullOrEmpty(zxjZsdstr020.getSjdy()));
            item.addElement("VBELN").setText(judgeNullOrEmpty(zxjZsdstr020.getVbeln()));
            item.addElement("BSSNU").setText(judgeNullOrEmpty(zxjZsdstr020.getBssnu()));
            item.addElement("HK_STATUS").setText(judgeNullOrEmpty(zxjZsdstr020.getHkStatus()));
            item.addElement("YHKJE").setText("".equals(judgeNullOrEmpty(zxjZsdstr020.getYhkje())) ? "" : df.format(zxjZsdstr020.getYhkje()));
            item.addElement("WHKJE").setText("".equals(judgeNullOrEmpty(zxjZsdstr020.getWhkje())) ? "" : df.format(zxjZsdstr020.getWhkje()));
            item.addElement("HKRQ").setText(judgeNullOrEmpty(zxjZsdstr020.getHkrq()));
            item.addElement("ZCRMID").setText(judgeNullOrEmpty(zxjZsdstr020.getZcrmid()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjZsdstr020.getDatum()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjZsdstr020.getUzeit()));
            item.addElement("NETWR").setText("".equals(judgeNullOrEmpty(zxjZsdstr020.getNetwr())) ? "" : df.format(zxjZsdstr020.getNetwr()));
            item.addElement("BSTKD").setText(judgeNullOrEmpty(zxjZsdstr020.getBstkd()));
            item.addElement("SFHK").setText(judgeNullOrEmpty(zxjZsdstr020.getZsfhk()));
        }
        return document.asXML();
    }


    public String getXmlOf029(List<ZxjZsdstr029> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjZsdstr029 zxjZsdstr029 : list) {
            Element item = root.addElement("item");
            item.addElement("WERKS").setText(judgeNullOrEmpty(zxjZsdstr029.getWerks()));
            item.addElement("VBELN").setText(judgeNullOrEmpty(zxjZsdstr029.getVbeln()));
            item.addElement("POSNR").setText(judgeNullOrEmpty(zxjZsdstr029.getPosnr()));
            item.addElement("MATNR").setText(judgeNullOrEmpty(zxjZsdstr029.getMatnr()));
            item.addElement("STLNR").setText(judgeNullOrEmpty(zxjZsdstr029.getStlnr()));
            item.addElement("AUFNR").setText(judgeNullOrEmpty(zxjZsdstr029.getAufnr()));
            item.addElement("IDNRK").setText(judgeNullOrEmpty(zxjZsdstr029.getIdnrk()));
            item.addElement("MENGE").setText(judgeNullOrEmpty(zxjZsdstr029.getMenge()));
            item.addElement("ZOPSTA").setText(judgeNullOrEmpty(zxjZsdstr029.getZopsta()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjZsdstr029.getDatum()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjZsdstr029.getUzeit()));
            item.addElement("ID").setText(judgeNullOrEmpty(zxjZsdstr029.getId()));
            item.addElement("SXH").setText(judgeNullOrEmpty(zxjZsdstr029.getSxh()));
            item.addElement("POTX1").setText(judgeNullOrEmpty(zxjZsdstr029.getPotx1()));
        }
        return document.asXML();
    }


    public String getXmlOfCgrk(List<ZxjMesCgrk> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesCgrk zxjMesCgrk : list) {
            Element item = root.addElement("item");
            item.addElement("EBELN").setText(judgeNullOrEmpty(zxjMesCgrk.getEbeln()));
            item.addElement("EBELP").setText(judgeNullOrEmpty(zxjMesCgrk.getEbelp()));
            item.addElement("MATNR").setText(judgeNullOrEmpty(zxjMesCgrk.getMatnr()));
            item.addElement("MAKTX").setText(judgeNullOrEmpty(zxjMesCgrk.getMaktx()));
            item.addElement("MENGE").setText(judgeNullOrEmpty(zxjMesCgrk.getMenge()));
            item.addElement("WERKS").setText(judgeNullOrEmpty(zxjMesCgrk.getWerks()));
            item.addElement("LGORT").setText(judgeNullOrEmpty(zxjMesCgrk.getLgort()));
            item.addElement("BUDAT").setText(judgeNullOrEmpty(zxjMesCgrk.getBudat()));
            item.addElement("ERDAT").setText(judgeNullOrEmpty(zxjMesCgrk.getErdat()));
            item.addElement("BWART").setText(judgeNullOrEmpty(zxjMesCgrk.getBwart()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjMesCgrk.getDatum()));
            item.addElement("ID").setText(judgeNullOrEmpty(zxjMesCgrk.getId()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjMesCgrk.getUzeit()));
        }
        return document.asXML();
    }

    public String getXmlOfWwrk(List<ZxjMesWwrk> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesWwrk zxjMesWwrk : list) {
            Element item = root.addElement("item");
            item.addElement("EBELN").setText(judgeNullOrEmpty(zxjMesWwrk.getEbeln()));
            item.addElement("EBELP").setText(judgeNullOrEmpty(zxjMesWwrk.getEbelp()));
            item.addElement("MATNR").setText(judgeNullOrEmpty(zxjMesWwrk.getMatnr()));
            item.addElement("MAKTX").setText(judgeNullOrEmpty(zxjMesWwrk.getMaktx()));
            item.addElement("MENGE").setText(judgeNullOrEmpty(zxjMesWwrk.getMenge()));
            item.addElement("WERKS").setText(judgeNullOrEmpty(zxjMesWwrk.getWerks()));
            item.addElement("LGORT").setText(judgeNullOrEmpty(zxjMesWwrk.getLgort()));
            item.addElement("BUDAT").setText(judgeNullOrEmpty(zxjMesWwrk.getBudat()));
            item.addElement("ERDAT").setText(judgeNullOrEmpty(zxjMesWwrk.getErdat()));
            item.addElement("BWART").setText(judgeNullOrEmpty(zxjMesWwrk.getBwart()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjMesWwrk.getDatum()));
            item.addElement("ID").setText(judgeNullOrEmpty(zxjMesWwrk.getId()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjMesWwrk.getUzeit()));
        }
        return document.asXML();
    }

    public String getXmlOfScck(List<ZxjMesScck> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesScck zxjMesScck : list) {
            Element item = root.addElement("item");
            item.addElement("AUFNR").setText(judgeNullOrEmpty(zxjMesScck.getAufnr()));
            item.addElement("POSNR").setText(judgeNullOrEmpty(zxjMesScck.getPosnr()));
            item.addElement("MATNR").setText(judgeNullOrEmpty(zxjMesScck.getMatnr()));
            item.addElement("MAKTX").setText(judgeNullOrEmpty(zxjMesScck.getMaktx()));
            item.addElement("MENGE").setText(judgeNullOrEmpty(zxjMesScck.getMenge()));
            item.addElement("WERKS").setText(judgeNullOrEmpty(zxjMesScck.getWerks()));
            item.addElement("LGORT").setText(judgeNullOrEmpty(zxjMesScck.getLgort()));
            item.addElement("RSNUM").setText(judgeNullOrEmpty(zxjMesScck.getRsnum()));
            item.addElement("RSPOS").setText(judgeNullOrEmpty(zxjMesScck.getRspos()));
            item.addElement("BUDAT").setText(judgeNullOrEmpty(zxjMesScck.getBudat()));
            item.addElement("ERDAT").setText(judgeNullOrEmpty(zxjMesScck.getErdat()));
            item.addElement("BWART").setText(judgeNullOrEmpty(zxjMesScck.getBwart()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjMesScck.getDatum()));
            item.addElement("ID").setText(judgeNullOrEmpty(zxjMesScck.getId()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjMesScck.getUzeit()));
            item.addElement("TYPE").setText(judgeNullOrEmpty(zxjMesScck.getType()));
        }
        return document.asXML();
    }


    public String getXmlOfCprk(List<ZxjM2sCprk> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjM2sCprk zxjM2sCprk : list) {
            Element item = root.addElement("item");
            item.addElement("AUFNR").setText(judgeNullOrEmpty(zxjM2sCprk.getAufnr()));
            item.addElement("POSNR").setText(judgeNullOrEmpty(zxjM2sCprk.getPosnr()));
            item.addElement("ERFMG").setText(judgeNullOrEmpty(zxjM2sCprk.getErfmg()));
            item.addElement("WERKS").setText(judgeNullOrEmpty(zxjM2sCprk.getWerks()));
            item.addElement("LGORT").setText(judgeNullOrEmpty(zxjM2sCprk.getLgort()));
            item.addElement("BUDAT_MKPF").setText(judgeNullOrEmpty(zxjM2sCprk.getBudatMkpf()));
            item.addElement("CPUDT_MKPF").setText(judgeNullOrEmpty(zxjM2sCprk.getCpudtMkpf()));
            item.addElement("SGTXT").setText(judgeNullOrEmpty(zxjM2sCprk.getSgtxt()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjM2sCprk.getDatum()));
            item.addElement("ID").setText(judgeNullOrEmpty(zxjM2sCprk.getId()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjM2sCprk.getUzeit()));
            item.addElement("BWART").setText(judgeNullOrEmpty(zxjM2sCprk.getBwart()));
        }
        return document.asXML();
    }

    /*
     生成凭证冲销XML
    * */
    public String getXmlOfPzcx(List<ZxjMesPzcx> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesPzcx zxjMesPzcx : list) {
            Element item = root.addElement("item");
            item.addElement("MBLNR").setText(judgeNullOrEmpty(zxjMesPzcx.getMblnr()));
            item.addElement("MJAHR").setText(judgeNullOrEmpty(zxjMesPzcx.getMjahr()));
            item.addElement("ZEILE").setText(judgeNullOrEmpty(zxjMesPzcx.getZeile()));
            item.addElement("BUDAT").setText(judgeNullOrEmpty(zxjMesPzcx.getBudat()));
            item.addElement("ERDAT").setText(judgeNullOrEmpty(zxjMesPzcx.getErdat()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjMesPzcx.getDatum()));
            item.addElement("ID").setText(judgeNullOrEmpty(zxjMesPzcx.getId()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjMesPzcx.getUzeit()));
        }
        return document.asXML();
    }

    /*
    生成批量移库XML
    * */
    public String getXmlOfPlyk(List<ZxjMesPlyk> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesPlyk zxjMesPlyk : list) {
            Element item = root.addElement("item");
            item.addElement("WERKS_FC").setText(judgeNullOrEmpty(zxjMesPlyk.getWerksFc()));
            item.addElement("LGORT_FC").setText(judgeNullOrEmpty(zxjMesPlyk.getLgortFc()));
            item.addElement("WERKS_JS").setText(judgeNullOrEmpty(zxjMesPlyk.getWerksJs()));
            item.addElement("LGORT_JS").setText(judgeNullOrEmpty(zxjMesPlyk.getLgortJs()));
            item.addElement("MATNR").setText(judgeNullOrEmpty(zxjMesPlyk.getMatnr()));
            item.addElement("MENGE").setText(judgeNullOrEmpty(zxjMesPlyk.getMenge()));
            item.addElement("SOBKZ").setText(judgeNullOrEmpty(zxjMesPlyk.getSobkz()));
            item.addElement("LIFNR").setText(judgeNullOrEmpty(zxjMesPlyk.getLifnr()));
            item.addElement("BWART").setText(judgeNullOrEmpty(zxjMesPlyk.getBwart()));
            item.addElement("BUDAT").setText(judgeNullOrEmpty(zxjMesPlyk.getBudat()));
            item.addElement("ERDAT").setText(judgeNullOrEmpty(zxjMesPlyk.getErdat()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjMesPlyk.getDatum()));
            item.addElement("ID").setText(judgeNullOrEmpty(zxjMesPlyk.getId()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjMesPlyk.getUzeit()));
            item.addElement("EBELN").setText(judgeNullOrEmpty(zxjMesPlyk.getEbeln()));
            item.addElement("EBELP").setText(judgeNullOrEmpty(zxjMesPlyk.getEbelp()));
            item.addElement("VBELN_FC").setText(judgeNullOrEmpty(zxjMesPlyk.getVbelnFc()));
            item.addElement("VBELP_FC").setText(judgeNullOrEmpty(zxjMesPlyk.getVbelpFc()));
            item.addElement("VBELN_JS").setText(judgeNullOrEmpty(zxjMesPlyk.getVbelnJs()));
            item.addElement("VBELP_JS").setText(judgeNullOrEmpty(zxjMesPlyk.getVbelpJs()));
            item.addElement("POSID_FC").setText(judgeNullOrEmpty(zxjMesPlyk.getPosidFc()));
            item.addElement("POSID_JS").setText(judgeNullOrEmpty(zxjMesPlyk.getPosidJs()));

        }
        return document.asXML();
    }

    /*
   生成销售发货XML
   * */
    public String getXmlOfXsfh(List<ZxjMesXsfh> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesXsfh zxjMesXsfh : list) {
            Element item = root.addElement("item");
            item.addElement("VBELN").setText(judgeNullOrEmpty(zxjMesXsfh.getVbeln()));
            item.addElement("LFDAT").setText(judgeNullOrEmpty(zxjMesXsfh.getLfdat()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjMesXsfh.getDatum()));
            item.addElement("ID").setText(judgeNullOrEmpty(zxjMesXsfh.getId()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjMesXsfh.getUzeit()));
        }
        return document.asXML();
    }


    public String getXmlOfRecordInvoice(List<ZxjTaxHangxinToSap> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjTaxHangxinToSap zxjTaxHangxinToSap : list) {
            Element item = root.addElement("item");
            DecimalFormat df = new DecimalFormat("0.0000");
            SimpleDateFormat dateSdf = new SimpleDateFormat("yyyyMMdd");
            /*SimpleDateFormat dateSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");*/
            item.addElement("ID").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getId()));
            item.addElement("INVOICE_TYPE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getInvoiceType()));
            item.addElement("INVOICE_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getInvoiceCode()));
            item.addElement("INVOICE_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getInvoiceNo()));
            item.addElement("INVOICE_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getInvoiceDate()!=null?dateSdf.format(zxjTaxHangxinToSap.getInvoiceDate()):null));
            item.addElement("GF_TAX_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGfTaxNo()));
            item.addElement("GF_NAME").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGfName()));
            item.addElement("GF_ADDRESS_AND_PHONE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGfAddressAndPhone()));
            item.addElement("GF_BANK_AND_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGfBankAndNo()));
            item.addElement("XF_TAX_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getXfTaxNo()));

            item.addElement("XF_NAME").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getXfName()));
            item.addElement("XF_ADDRESS_AND_PHONE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getXfAddressAndPhone()));
            item.addElement("XF_BANK_AND_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getXfBankAndNo()));
            item.addElement("INVOICE_AMOUNT").setText("".equals(judgeNullOrEmpty(zxjTaxHangxinToSap.getInvoiceAmount())) ? "" : df.format(zxjTaxHangxinToSap.getInvoiceAmount()));
            item.addElement("TAX_AMOUNT").setText("".equals(judgeNullOrEmpty(zxjTaxHangxinToSap.getTaxAmount())) ? "" : df.format(zxjTaxHangxinToSap.getTaxAmount()));
            item.addElement("TOTAL_AMOUNT").setText("".equals(judgeNullOrEmpty(zxjTaxHangxinToSap.getTotalAmount())) ? "" : df.format(zxjTaxHangxinToSap.getTotalAmount()));
            item.addElement("REMARK").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRemark()));
            item.addElement("INVOICE_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getInvoiceStatus()));
            item.addElement("STATUS_UPDATE_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getStatusUpdateDate()!=null ? dateSdf.format(zxjTaxHangxinToSap.getStatusUpdateDate()):null));
            item.addElement("LAST_UPDATE_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getLastUpdateDate()!=null? dateSdf.format(zxjTaxHangxinToSap.getLastUpdateDate()):null));


            item.addElement("RZH_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRzhDate()!=null?dateSdf.format(zxjTaxHangxinToSap.getRzhDate()):null));
            item.addElement("QS_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getQsDate()!=null ? dateSdf.format(zxjTaxHangxinToSap.getQsDate()):null ));
            item.addElement("RZH_BELONG_DATE_LATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRzhBelongDateLate()));
            item.addElement("RZH_BELONG_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRzhBelongDate()));
            item.addElement("CONFIRM_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getConfirmDate()!=null ?dateSdf.format(zxjTaxHangxinToSap.getConfirmDate()):null));
            item.addElement("RZH_TYPE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRzhType()));
            item.addElement("RZH_YESORNO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRzhYesorno()));
            item.addElement("GX_USER_ACCOUNT").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGxUserAccount()));
            item.addElement("GX_USER_NAME").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGxUserName()));
            item.addElement("SOURCE_SYSTEM").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSourceSystem()));


            item.addElement("VALID").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getValid()));
            item.addElement("UUID").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getUuid()));
            item.addElement("CREATE_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCreateDate()!=null? dateSdf.format(zxjTaxHangxinToSap.getCreateDate()):null ));
            item.addElement("CHECK_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCheckDate()!=null? dateSdf.format(zxjTaxHangxinToSap.getCheckDate()):null));
            item.addElement("GX_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGxDate()!=null?dateSdf.format(zxjTaxHangxinToSap.getGxDate()):null));
            item.addElement("RZH_BACK_MSG").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRzhBackMsg()));
            item.addElement("DQSKSSQ").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getDqskssq()));
            item.addElement("GXJZR").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGxjzr()));
            item.addElement("GXFWQ").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGxfwq()));
            item.addElement("GXFWZ").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGxfwz()));


            item.addElement("SFYGX").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSfygx()));
            item.addElement("DETAIL_YESORNO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getDetailYesorno()));
            item.addElement("GX_TYPE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGxType()));
            item.addElement("AUTH_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getAuthStatus()));
            item.addElement("SEND_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSendDate()!=null ? dateSdf.format(zxjTaxHangxinToSap.getSendDate()):null));
            item.addElement("RZLX").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRzlx()));
            item.addElement("SFDBTS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSfdbts()));
            item.addElement("QS_TYPE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getQsType()));
            item.addElement("QS_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getQsStatus()));
            item.addElement("CHECK_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCheckCode()));

            item.addElement("TXFBZ").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getTxfbz()));
            item.addElement("LSLBZ").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getLslbz()));
            item.addElement("OUT_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getOutStatus()));
            item.addElement("OUT_INVOICE_AMOUT").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getOutInvoiceAmout()));
            item.addElement("OUT_TAX_AMOUNT").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getOutTaxAmount()));
            item.addElement("OUT_REASON").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getOutReason()));
            item.addElement("OUT_REMARK").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getOutRemark()));
            item.addElement("OUT_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getOutDate()!=null?dateSdf.format(zxjTaxHangxinToSap.getOutDate()):null));
            item.addElement("OUT_BELONG_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getOutBelongDate()));
            item.addElement("OUT_BY").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getOutBy()));

            item.addElement("CONFIRM_USER").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getConfirmUser()));
            item.addElement("MACHINECODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getMachinecode()));
            item.addElement("DEPT_ID").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getDeptId()));
            item.addElement("DEPT_NAME").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getDeptName()));
            item.addElement("SETTLEMENT_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSettlementNo()));
            item.addElement("SETTLEMENT_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSettlementStatus()));
            item.addElement("SETTLE_SOURCE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSettleSource()));
            item.addElement("PAYMENT_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getPaymentStatus()));
            item.addElement("PAYMENT_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getPaymentDate()));
            item.addElement("VOUCHER_NUMBER").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getVoucherNumber()));


            item.addElement("PAYMENT_SUM").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getPaymentSum()));
            item.addElement("QS_NAME").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getQsName()));
            item.addElement("YQSQ_MSG").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getYqsqMsg()));
            item.addElement("YQSQ_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getYqsqStatus()));
            item.addElement("GLZT").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getGlzt()));
            item.addElement("XXLY").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getXxly()));
            item.addElement("DK_TAX_AMOUNT").setText("".equals(judgeNullOrEmpty(zxjTaxHangxinToSap.getDkTaxAmount())) ? "" : df.format(zxjTaxHangxinToSap.getDkTaxAmount()));
            item.addElement("YQKGXBZ").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getYqkgxbz()));
            item.addElement("YCLX").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getYclx()));
            item.addElement("YQSHZT").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getYqshzt()));


            item.addElement("USER_ACCOUNT").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getUserAccount()));
            item.addElement("NEW_GF_TAXNO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getNewGfTaxno()));
            item.addElement("YQ_CURRENT_PERIOD").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getYqCurrentPeriod()));
            item.addElement("COMPANY").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCompany()));
            item.addElement("CXRZ_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCxrzStatus()));
            item.addElement("CXRZ_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCxrzDate()!=null ? dateSdf.format(zxjTaxHangxinToSap.getCxrzDate()):null));
            item.addElement("BDK_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getBdkStatus()));
            item.addElement("BDK_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getBdkDate()!=null ? dateSdf.format(zxjTaxHangxinToSap.getBdkDate()) :null));
            item.addElement("CXRZ_CURRENT_PERIOD").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCxrzCurrentPeriod()));
            item.addElement("BDK_CURRENT_PERIOD").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getBdkCurrentPeriod()));

            item.addElement("CXBDK_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCxbdkStatus()));
            item.addElement("CXBDK_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCxbdkDate()!=null? dateSdf.format(zxjTaxHangxinToSap.getCxbdkDate()) : null));
            item.addElement("YQSQ_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getYqsqDate()!=null ? dateSdf.format(zxjTaxHangxinToSap.getYqsqDate()):null));
            item.addElement("YQSH_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getYqshDate()!=null ? dateSdf.format(zxjTaxHangxinToSap.getYqshDate()):null));
            item.addElement("VENDOR_ID").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getVendorId()));
            item.addElement("REQUEST_ID").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRequestId()));
            item.addElement("SCAN_MATCH_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getScanMatchStatus()));
            item.addElement("SCAN_MATCH_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getScanMatchDate()!=null ? dateSdf.format(zxjTaxHangxinToSap.getScanMatchDate()):null));
            item.addElement("COLLECT_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCollectDate()!=null? dateSdf.format(zxjTaxHangxinToSap.getCollectDate()):null));
            item.addElement("ORDER_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getOrderNo()));

            item.addElement("IS_AUTH").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getIsAuth()));
            item.addElement("EXPORT_MARK").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getExportMark()));
            item.addElement("SCAN_ID").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getScanId()));
            item.addElement("DOCUMENT_NUMBER").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getDocumentNumber()));
            item.addElement("AMORTIZE_USER").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getAmortizeUser()));
            item.addElement("AMORTIZE_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getAmortizeStatus()));
            item.addElement("AMORTIZE_AMOUNT").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getAmortizeAmount()));
            item.addElement("REMAIN_AMORTIZE_AMOUNT").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRemainAmortizeAmount()));
            item.addElement("AMORTIZE_DOCUMENT_NUMBER").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getAmortizeDocumentNumber()));
            item.addElement("PAYEE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getPayee()));


            item.addElement("REVIEWER").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getReviewer()));
            item.addElement("PRINTOR").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getPrintor()));
            item.addElement("IS_SALE_LIST").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getIsSaleList()));
            item.addElement("IS_RED").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getIsRed()));
            item.addElement("BLUE_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getBlueCode()));
            item.addElement("BLUE_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getBlueNo()));
            item.addElement("IN_ACCOUNT_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getInAccountStatus()));
            item.addElement("IN_ACCOUNT_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getInAccountDate()!=null?dateSdf.format(zxjTaxHangxinToSap.getInAccountDate()):null));
            item.addElement("ILLEGAL_SUPPLIER").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getIllegalSupplier()));
            item.addElement("PROFIT_CENTER").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getProfitCenter()));


           // item.addElement("ZFLAG").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getZflag()));
            item.addElement("SEND_RZ_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSendRzStatus()));
            item.addElement("SEND_RZ_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSendRzDate()!=null?dateSdf.format(zxjTaxHangxinToSap.getSendRzDate()):null));
            item.addElement("SEND_QS_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSendQsStatus()));
            item.addElement("SEND_QS_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getSendQsDate()!=null ? dateSdf.format(zxjTaxHangxinToSap.getSendQsDate()):null));
            item.addElement("MATCHSTATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getMatchstatus()));
            item.addElement("MATCH_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getMatchNo()));
            item.addElement("MATCH_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getMatchDate()!=null ? dateSdf.format(zxjTaxHangxinToSap.getMatchDate()):null));
            item.addElement("MATCH_ERRINFO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getMatchErrinfo()));
            item.addElement("MATCH_USER").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getMatchUser()));


            item.addElement("MATCH_COST").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getMatchCost()));
            item.addElement("MATCH_VAT").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getMatchVat()));
            item.addElement("VENDER_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getVenderNo()));
            item.addElement("COLLECT_FROM").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCollectFrom()));
            item.addElement("COLLECT_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCollectStatus()));
            item.addElement("POOL_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getPoolStatus()));
            item.addElement("IN_POOL_REASON").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getInPoolReason()));
            item.addElement("VOUCHER_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getVoucherNo()));
            item.addElement("MW").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getMw()));
            item.addElement("JDHM").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getJdhm()));


            item.addElement("DK_TAXNO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getDkTaxno()));
            item.addElement("DK_TAXNAME").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getDkTaxname()));
            item.addElement("DK_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getDkStatus()));
            item.addElement("INVOICER").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getInvoicer()));
            item.addElement("RELATED_BUSINESS_DOCUMENTS").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getRelatedBusinessDocuments()));
      /*      item.addElement("CREATE_TIME").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getCreateTime()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getDatum()));
            item.addElement("VOUCHER_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getVoucherNo()));
            item.addElement("MW").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getMw()));
            item.addElement("JDHM").setText(judgeNullOrEmpty(zxjTaxHangxinToSap.getJdhm()));*/

            item.addElement("DATUM").setText(judgeNullOrEmpty(DateTimeUtils.dateToStr(zxjTaxHangxinToSap.getDatum())));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(DateTimeUtils.timeToStr(zxjTaxHangxinToSap.getDatum())));
        }

        return document.asXML();
    }



    public String getXmlOfCustomRecord(List<ZxjTaxHangxinToSapCustoms> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjTaxHangxinToSapCustoms zxjTaxHangxinToSapCustoms : list) {
            Element item = root.addElement("item");
            DecimalFormat df = new DecimalFormat("0.00");
            SimpleDateFormat dateSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            item.addElement("ID").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getId()));
            item.addElement("GF_NAME").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getGfName()));
            item.addElement("GF_TAX_NO").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getGfTaxNo()));
            item.addElement("CUSTOMS_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCustomsCode()));
            item.addElement("PAYER_ONE_TAXNO").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getPayerOneTaxno()));
            item.addElement("PAYER_ONE_NAME").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getPayerOneName()));
            item.addElement("PAYER_TWO_TAXNO").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getPayerTwoTaxno()));
            item.addElement("PAYER_TWO_NAME").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getPayerTwoName()));
            item.addElement("FILL_IN_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getFillInDate()));
            item.addElement("TAX_AMOUNT").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getTaxAmount()));

            item.addElement("YX_TAX_AMOUNT").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getYxTaxAmount()));
            item.addElement("IMPORT_PORT_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getImportPortCode()));
            item.addElement("INCOME_OFFICE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getIncomeOffice()));
            item.addElement("APPLICANT_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getApplicantCode()));
            item.addElement("BILL_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getBillCode()));
            item.addElement("MODE_TYPE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getModeType()));
            item.addElement("BUDGET_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getBudgetCode()));
            item.addElement("TREASURY_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getTreasuryCode()));
            item.addElement("CONTRACT_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getContractCode()));
            item.addElement("MEANS_TRANSPORT").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getMeansTransport()));


            item.addElement("PAYMENT_PERIOD").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getPaymentPeriod()));
            item.addElement("DELIVERY_CODE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getDeliveryCode()));
            item.addElement("DATA_SOURCES").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getDataSources()));
            item.addElement("CREATE_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCreateDate()));
            item.addElement("DATA_TYPE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getDataType()));
            item.addElement("COLLECT_UPLOAD_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCollectUploadStatus()));
            item.addElement("AUDIT_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getAuditStatus()));
            item.addElement("APPLY_CHECK").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getApplyCheck()));
            item.addElement("FAIL_REASON").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getFailReason()));
            item.addElement("CHECK_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCheckStatus()));


            item.addElement("QS_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getQsStatus()));
            item.addElement("QS_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getQsDate()));
            item.addElement("QS_TYPE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getQsType()));
            item.addElement("QS_USER").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getQsUser()));
            item.addElement("RZH_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getRzhDate()));
            item.addElement("UPDATE_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getUpdateDate()));
            item.addElement("RZH_BELONG_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getRzhBelongDate()));
            item.addElement("CONFIRM_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getConfirmDate()));
            item.addElement("RZH_TYPE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getRzhType()));
            item.addElement("RZH_YESORNO").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getRzhYesorno()));


            item.addElement("DQSKSSQ").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getDqskssq()));
            item.addElement("GXJZR").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getGxjzr()));
            item.addElement("GXFWQ").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getGxfwq()));
            item.addElement("RZH_BACK_MSG").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getRzhBackMsg()));
            item.addElement("GXFWZ").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getGxfwz()));
            item.addElement("DETAIL_YESORNO").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getDetailYesorno()));
            item.addElement("AUTH_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getAuthStatus()));
            item.addElement("SEND_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getSendDate()));
            item.addElement("RZLX").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getRzlx()));
            item.addElement("CONFIRM_USER").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getConfirmUser()));


            item.addElement("DEPT_ID").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getDeptId()));
            item.addElement("DEPT_NAME").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getDeptName()));
            item.addElement("GLZT").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getGlzt()));
            item.addElement("XXLY").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getXxly()));
            item.addElement("CXRZ_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCxrzStatus()));
            item.addElement("CXRZ_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCxrzDate()));
            item.addElement("CXRZ_CURRENT_PERIOD").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCxrzCurrentPeriod()));
            item.addElement("BDK_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getBdkStatus()));
            item.addElement("CXBDK_STATUS").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCxbdkDate()));
            item.addElement("CXBDK_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCxbdkDate()));

            item.addElement("BDK_CURRENT_PERIOD").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getBdkCurrentPeriod()));
            item.addElement("ENTRY_DISCREPANCY").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getEntryDiscrepancy()));
            item.addElement("CUSTOMS_SCAN_ID").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCustomsScanId()));
            item.addElement("EXPORT_MARK").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getExportMark()));
            item.addElement("ENTRY_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getEntryDate()));
            item.addElement("COLLECT_UPLOAD_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCollectUploadStatus()));
            item.addElement("UPLOAD_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getUploadDate()));
            item.addElement("COMPANY").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getCompany()));
            item.addElement("STATUS_UPDATE_DATE").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getStatusUpdateDate()));
            item.addElement("ENTRY_USER").setText(judgeNullOrEmpty(zxjTaxHangxinToSapCustoms.getEntryDate()));
        }

        return document.asXML();
    }


    /*
  生成销售发货XML
  * */
    public String getXmlOf221yk(List<ZxjMes221yk> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMes221yk zxjMes221yk: list) {
            Element item = root.addElement("item");
            item.addElement("WERKS_FC").setText(judgeNullOrEmpty(zxjMes221yk.getWerksFc()));
            item.addElement("LGORT_FC").setText(judgeNullOrEmpty(zxjMes221yk.getLgortFc()));
            item.addElement("MATNR").setText(judgeNullOrEmpty(zxjMes221yk.getMatnr()));
            item.addElement("SOBKZ").setText(judgeNullOrEmpty(zxjMes221yk.getSobkz()));
            item.addElement("BWART").setText(judgeNullOrEmpty(zxjMes221yk.getBwart()));
            item.addElement("BUDAT").setText(judgeNullOrEmpty(zxjMes221yk.getBudat()));
            item.addElement("ERDAT").setText(judgeNullOrEmpty(zxjMes221yk.getErdat()));
            item.addElement("POSID").setText(judgeNullOrEmpty(zxjMes221yk.getPosid()));
            item.addElement("MENGE").setText(judgeNullOrEmpty(zxjMes221yk.getMenge()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(zxjMes221yk.getDatum()));
            item.addElement("ID").setText(judgeNullOrEmpty(zxjMes221yk.getId()));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(zxjMes221yk.getUzeit()));
        }
        return document.asXML();
    }
    public String getXmlOfXsdd02(List<ZxjMesXsdd02> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesXsdd02 zxjMesXsdd02: list) {
            Element item = root.addElement("item");
            item.addElement("VBELN").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getVbeln()));
            item.addElement("POSNR").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getPosnr()));
            item.addElement("MATNR").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getMatnr()));
            item.addElement("ARKTX").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getArktx()));
            item.addElement("KWMENG").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getKwmeng()));
            item.addElement("VRKME").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getVrkme()));
            item.addElement("WERKS").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getWerks()));
            item.addElement("PSTYV").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getPstyv()));
            item.addElement("KBETR").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getKbetr()));
            item.addElement("KPEIN").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getKpein()));
            item.addElement("KDKG1").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getKdkg1()));
            item.addElement("ETTYP").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getEttyp()));
            item.addElement("BEDAE").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getBedae()));
            item.addElement("ID").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getId()));
            item.addElement("DATUM").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getDatum()));
            item.addElement("UZEIT").setText(JudgeUtils.judgeNullOrEmpty(zxjMesXsdd02.getUzeit()));
        }

        return document.asXML();
    }



    public String getXmlOfGhd(List<ZxjMesGhd> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesGhd zxjMesGhd: list) {
            Element item = root.addElement("item");
            DecimalFormat df = new DecimalFormat("0.00");
            item.addElement("CGGHD_ID").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getCgghdId()));
            item.addElement("CGGHD_NUMBER").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getCgghdNumber()));
            item.addElement("CGGHD_COMPANY").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getCgghdCompany()));
            item.addElement("CGGHD_CONTRACT").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getCgghdContract()));
            item.addElement("CGGHD_LINE_ITEM").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getCgghdLineItem()));
            item.addElement("GOODS_NAME").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getGoodsName()));
            item.addElement("MODEL").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getModel()));
            item.addElement("UNIT").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getUnit()));
            item.addElement("QUATITY").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getQuatity()));
            item.addElement("UNIT_PRICE").setText("".equals(judgeNullOrEmpty(zxjMesGhd.getUnitPrice())) ? "" : df.format(zxjMesGhd.getUnitPrice()));
            item.addElement("LINE_UNIT_PRICE").setText("".equals(judgeNullOrEmpty(zxjMesGhd.getLineUnitPrice())) ? "" : df.format(zxjMesGhd.getLineUnitPrice()) );
            item.addElement("NONE_TAX_PRICE").setText("".equals(judgeNullOrEmpty(zxjMesGhd.getNoneTaxPrice())) ? "" : df.format(zxjMesGhd.getNoneTaxPrice()));
            item.addElement("TAX_PRICE").setText("".equals(judgeNullOrEmpty(zxjMesGhd.getTaxPrice())) ? "" : df.format(zxjMesGhd.getTaxPrice()));
            item.addElement("WHR").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getWhr()));
            item.addElement("WHRQ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getWhrq()));
            item.addElement("WHSJ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getWhsj()));
            item.addElement("CJR").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getCjr()));
            item.addElement("CJRQ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getCjrq()));
            item.addElement("CJSJ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getCjsj()));
            item.addElement("VKORG").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getVkorg()));
            item.addElement("LOEKZ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getLoekz()));
            item.addElement("DDPT_HTBH").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getDdptHtbh()));
            item.addElement("DDPT_XMMC").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getDdptXmmc()));
            item.addElement("DDPT_KJHT").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getDdptKjht()));
            Date dateNow = new Date();
            item.addElement("DATUM").setText(DateTimeUtils.dateToStr(dateNow));
            item.addElement("ID").setText(JudgeUtils.judgeNullOrEmpty(zxjMesGhd.getId()));
            item.addElement("UZEIT").setText(DateTimeUtils.timeToStr(dateNow));
        }
        return document.asXML();
    }



    public String getXmlOfKpxx(List<ZxjMesKpxx> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesKpxx zxjMesKpxx: list) {
            Element item = root.addElement("item");
            DecimalFormat df = new DecimalFormat("0.00");
            item.addElement("APPLY_NUMBER").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getApplyNumber()));
            item.addElement("PROVINCES").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getProvinces()));
            item.addElement("ZKJHT_KJDD").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getZkjhtKjdd()));
            item.addElement("JSZTBH").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getJsztbh()));
            item.addElement("CGGHDH").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getCgghdh()));
            item.addElement("GFDW").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getGfdw()));
            item.addElement("KPJE_HS").setText( "".equals(judgeNullOrEmpty(zxjMesKpxx.getKpjeHs())) ? "" : df.format(zxjMesKpxx.getKpjeHs()));
            item.addElement("KPJE_BHS").setText("".equals(judgeNullOrEmpty(zxjMesKpxx.getKpjeBhs())) ? "" : df.format(zxjMesKpxx.getKpjeBhs()));
            item.addElement("WHR").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getWhr()));
            item.addElement("WHRQ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getWhrq()));
            item.addElement("WHSJ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getWhsj()));
            item.addElement("CJR").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getCjr()));
            item.addElement("CJRQ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getCjrq()));
            item.addElement("CJSJ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getCjsj()));
            item.addElement("VKORG").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getVkorg()));
            item.addElement("LOEKZ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getLoekz()));
            item.addElement("ID").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getId()));
            Date dateNow = new Date();
            item.addElement("DATUM").setText(DateTimeUtils.dateToStr(dateNow));
            item.addElement("UZEIT").setText(DateTimeUtils.timeToStr(dateNow));

           /*2023-02-09添加*/
            item.addElement("APPLY_LINE_ID").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getApplyLineId()));
            item.addElement("STCEG").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getStceg()));
            item.addElement("STREET").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getStreet()));
            item.addElement("IPONE").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getIpone()));
            item.addElement("BANAME").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getBaname()));
            item.addElement("BANKN").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getBankn()));
            item.addElement("BEIZ").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getBeiz()));
            item.addElement("LINE_ITEM").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getLineItem()));
           // item.addElement("PREIS").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getPreis()));
            item.addElement("PREIS").setText("".equals(judgeNullOrEmpty(zxjMesKpxx.getPreis())) ? "" : df.format(zxjMesKpxx.getPreis()));
            item.addElement("MAKTX").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getMaktx()));
            item.addElement("SPEC").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getSpec()));
            item.addElement("MEINS").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getMeins()));
          //  item.addElement("MENGE").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getMenge()));
            item.addElement("MENGE").setText("".equals(judgeNullOrEmpty(zxjMesKpxx.getMenge())) ? "" : df.format(zxjMesKpxx.getMenge()));
          //  item.addElement("NO_TAX_PRICE").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getNoTaxPrice()));
            item.addElement("NO_TAX_PRICE").setText("".equals(judgeNullOrEmpty(zxjMesKpxx.getNoTaxPrice())) ? "" : df.format(zxjMesKpxx.getNoTaxPrice()));
            item.addElement("SL").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getSl()));
           // item.addElement("FPSE1").setText(JudgeUtils.judgeNullOrEmpty(zxjMesKpxx.getFpse1()));
            item.addElement("FPSE1").setText("".equals(judgeNullOrEmpty(zxjMesKpxx.getFpse1())) ? "" : df.format(zxjMesKpxx.getFpse1()));
            item.addElement("PURCHASEMARK").setText(judgeNullOrEmpty(zxjMesKpxx.getPurchasemark()));
            item.addElement("PHONE").setText(judgeNullOrEmpty(zxjMesKpxx.getPhone()));
            item.addElement("MAIL").setText(judgeNullOrEmpty(zxjMesKpxx.getMail()));
            item.addElement("INVOICETYPE").setText(judgeNullOrEmpty(zxjMesKpxx.getInvoicetype()));

        }
        return document.asXML();
    }


    public String getXmlOf012New(List<ZxjZsdstr012New> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjZsdstr012New zxjZsdstr012New : list) {
            Element item = root.addElement("item");
            item.addElement("ID").setText(judgeNullOrEmpty(zxjZsdstr012New.getId()));
            item.addElement("KUNNR").setText(judgeNullOrEmpty(zxjZsdstr012New.getKunnr()));
            item.addElement("KTOKD").setText(judgeNullOrEmpty(zxjZsdstr012New.getKtokd()));
            item.addElement("KUKLA").setText(judgeNullOrEmpty(zxjZsdstr012New.getKukla()));
            item.addElement("BRAN1").setText(judgeNullOrEmpty(zxjZsdstr012New.getBran1()));
            item.addElement("NAME1").setText(judgeNullOrEmpty(zxjZsdstr012New.getName1()));
            item.addElement("LAND1").setText(judgeNullOrEmpty(zxjZsdstr012New.getLand1()));
            item.addElement("REGIO").setText(judgeNullOrEmpty(zxjZsdstr012New.getRegio()));
            item.addElement("ORT01").setText(judgeNullOrEmpty(zxjZsdstr012New.getOrt01()));
            item.addElement("STCEG").setText(judgeNullOrEmpty(zxjZsdstr012New.getStceg()));
            item.addElement("BANKS").setText(judgeNullOrEmpty(zxjZsdstr012New.getBanks()));
            item.addElement("BANKL").setText(judgeNullOrEmpty(zxjZsdstr012New.getBankl()));

            item.addElement("BANKA").setText(judgeNullOrEmpty(zxjZsdstr012New.getBanka()));
            item.addElement("BANKN").setText(judgeNullOrEmpty(zxjZsdstr012New.getBankn()));
            item.addElement("KOINH").setText(judgeNullOrEmpty(zxjZsdstr012New.getKoinh()));


     /*       item.addElement("BLAND").setText(judgeNullOrEmpty(zxjZsdstr012.getBland()));
            item.addElement("SORT1").setText(judgeNullOrEmpty(zxjZsdstr012.getSort1()));
            item.addElement("LAND1").setText(judgeNullOrEmpty(zxjZsdstr012.getLand1()));
            item.addElement("AKONT").setText(judgeNullOrEmpty(zxjZsdstr012.getAkont()));
            item.addElement("BUKRS").setText(judgeNullOrEmpty(zxjZsdstr012.getBukrs()));*/

            item.addElement("DATUM").setText(judgeNullOrEmpty(DateTimeUtils.dateToStr(zxjZsdstr012New.getDatum())));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(DateTimeUtils.timeToStr(zxjZsdstr012New.getUzeit())));

        }
        return document.asXML();
    }


    public String getXmlOfKunnrKz(List<ZxjMesKunnrKz> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesKunnrKz zxjMesKunnrKz : list) {
            Element item = root.addElement("item");
            item.addElement("ID").setText(judgeNullOrEmpty(zxjMesKunnrKz.getId()));
            item.addElement("KUNNR").setText(judgeNullOrEmpty(zxjMesKunnrKz.getKunnr()));
            item.addElement("VKORG").setText(judgeNullOrEmpty(zxjMesKunnrKz.getVkorg()));
            item.addElement("AWAHR").setText(judgeNullOrEmpty(zxjMesKunnrKz.getAwahr()));
            item.addElement("WAERS").setText(judgeNullOrEmpty(zxjMesKunnrKz.getWaers()));
            item.addElement("KALKS").setText(judgeNullOrEmpty(zxjMesKunnrKz.getKalks()));
            item.addElement("VSBED").setText(judgeNullOrEmpty(zxjMesKunnrKz.getVsbed()));
            item.addElement("VWERK").setText(judgeNullOrEmpty(zxjMesKunnrKz.getVwerk()));
            item.addElement("KZAZU").setText(judgeNullOrEmpty(zxjMesKunnrKz.getKzazu()));
            item.addElement("ANTLF").setText(judgeNullOrEmpty(zxjMesKunnrKz.getAntlf()));
            item.addElement("ZTERM").setText(judgeNullOrEmpty(zxjMesKunnrKz.getZterm()));
            item.addElement("KTGRD").setText(judgeNullOrEmpty(zxjMesKunnrKz.getKtgrd()));

            item.addElement("TAXKD").setText(judgeNullOrEmpty(zxjMesKunnrKz.getTaxkd()));

            item.addElement("DATUM").setText(judgeNullOrEmpty(DateTimeUtils.dateToStr(zxjMesKunnrKz.getDatum())));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(DateTimeUtils.timeToStr(zxjMesKunnrKz.getUzeit())));

            item.addElement("BUKRS").setText(judgeNullOrEmpty(zxjMesKunnrKz.getBukrs()));
            item.addElement("AKONT").setText(judgeNullOrEmpty(zxjMesKunnrKz.getAkont()));
            item.addElement("ERDAT").setText(judgeNullOrEmpty(DateTimeUtils.dateToStr(zxjMesKunnrKz.getErdat())));

        }
        return document.asXML();
    }


    public String getXmlOf011New(List<ZxjZsdstr011New> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjZsdstr011New zxjZsdstr011New : list) {
            Element item = root.addElement("item");
            DecimalFormat df = new DecimalFormat("0.00");
            item.addElement("VBELN").setText(judgeNullOrEmpty(zxjZsdstr011New.getVbeln()));


            item.addElement("HTHEAD").setText(judgeNullOrEmpty(zxjZsdstr011New.getHthead()));
            item.addElement("POSNR").setText(judgeNullOrEmpty(zxjZsdstr011New.getPosnr()));
            item.addElement("VKGRP").setText(judgeNullOrEmpty(zxjZsdstr011New.getVkgrp()));
            item.addElement("VKORG").setText(judgeNullOrEmpty(zxjZsdstr011New.getVkorg()));

            item.addElement("BNAME").setText(judgeNullOrEmpty(zxjZsdstr011New.getBname()));
            item.addElement("KDKG1").setText(judgeNullOrEmpty(zxjZsdstr011New.getKdkg1()));
            item.addElement("KUNNR").setText(judgeNullOrEmpty(zxjZsdstr011New.getKunnr()));
            item.addElement("KUNNR1").setText(judgeNullOrEmpty(zxjZsdstr011New.getKunnr1()));
            item.addElement("BSTZD").setText(judgeNullOrEmpty(zxjZsdstr011New.getBstzd()));
            item.addElement("AUGRU").setText(judgeNullOrEmpty(zxjZsdstr011New.getAugru()));

            item.addElement("BSTNK").setText(judgeNullOrEmpty(zxjZsdstr011New.getBstnk()));
            item.addElement("VTWEG").setText(judgeNullOrEmpty(zxjZsdstr011New.getVtweg()));
            item.addElement("SPART").setText(judgeNullOrEmpty(zxjZsdstr011New.getSpart()));
            item.addElement("KUNNR2").setText(judgeNullOrEmpty(zxjZsdstr011New.getKunnr2()));
            item.addElement("Z005").setText(judgeNullOrEmpty(zxjZsdstr011New.getZ005()));
            item.addElement("KUNNR3").setText(judgeNullOrEmpty(zxjZsdstr011New.getKunnr3()));
            item.addElement("KUNNR4").setText(judgeNullOrEmpty(zxjZsdstr011New.getKunnr4()));

            item.addElement("AUART").setText(judgeNullOrEmpty(zxjZsdstr011New.getAuart()));
            item.addElement("VKBUR").setText(judgeNullOrEmpty(zxjZsdstr011New.getVkbur()));
            item.addElement("BZIRK").setText(judgeNullOrEmpty(zxjZsdstr011New.getBzirk()));

            item.addElement("BSTDK").setText(judgeNullOrEmpty(DateTimeUtils.dateToStrOrNull(zxjZsdstr011New.getBstdk())));
            item.addElement("VDATU").setText(judgeNullOrEmpty(DateTimeUtils.dateToStrOrNull(zxjZsdstr011New.getVdatu())));

            item.addElement("KUNNR5").setText(judgeNullOrEmpty(zxjZsdstr011New.getKunnr5()));

            item.addElement("MAHDT").setText(judgeNullOrEmpty(DateTimeUtils.dateToStrOrNull(zxjZsdstr011New.getMahdt())));

            item.addElement("KVGR5").setText(judgeNullOrEmpty(zxjZsdstr011New.getKvgr5()));
            item.addElement("ZQDZL").setText(judgeNullOrEmpty(zxjZsdstr011New.getZqdzl()));
            item.addElement("ZQKTHF").setText(judgeNullOrEmpty(zxjZsdstr011New.getZqkthf()));
            item.addElement("ZHTDZ").setText(judgeNullOrEmpty(zxjZsdstr011New.getZhtdz()));
            item.addElement("ZAMT").setText("".equals(judgeNullOrEmpty(zxjZsdstr011New.getZamt())) ? "" : df.format(zxjZsdstr011New.getZamt()));
            item.addElement("ZTERM").setText(judgeNullOrEmpty(zxjZsdstr011New.getZterm()));


            item.addElement("ZDAT_FH").setText(judgeNullOrEmpty(DateTimeUtils.dateToStrOrNull(zxjZsdstr011New.getZdatFh())));
            item.addElement("ZDAT_TY").setText(judgeNullOrEmpty(DateTimeUtils.dateToStrOrNull(zxjZsdstr011New.getZdatTy())));

            item.addElement("BSTKD_E").setText(judgeNullOrEmpty(zxjZsdstr011New.getBstkdE()));
            item.addElement("KUNNR6").setText(judgeNullOrEmpty(zxjZsdstr011New.getKunnr6()));

            item.addElement("ZKJLB").setText(judgeNullOrEmpty(zxjZsdstr011New.getZkjlb()));
            item.addElement("ZYTHT_TCQR").setText(judgeNullOrEmpty(zxjZsdstr011New.getZythtTcqr()));
            item.addElement("ZYTHT_SQSPRQ").setText(judgeNullOrEmpty(zxjZsdstr011New.getZythtSqsprq()));

            item.addElement("ZYTHT_SQFHRQ").setText(judgeNullOrEmpty(zxjZsdstr011New.getZythtSqfhrq()));
            item.addElement("ZYTHT_YGQFRQ").setText(judgeNullOrEmpty(zxjZsdstr011New.getZythtYgqfrq()));

            item.addElement("AUDAT").setText(judgeNullOrEmpty(DateTimeUtils.dateToStrOrNull(zxjZsdstr011New.getAudat())));

            item.addElement("WAERK").setText(judgeNullOrEmpty(zxjZsdstr011New.getWaerk()));
            item.addElement("ZXMLX").setText(judgeNullOrEmpty(zxjZsdstr011New.getZxmlx()));
            item.addElement("ZZSBH").setText(judgeNullOrEmpty(zxjZsdstr011New.getZzsbh()));
            item.addElement("ABRVW").setText(judgeNullOrEmpty(zxjZsdstr011New.getAbrvw()));
            item.addElement("VSBED").setText(judgeNullOrEmpty(zxjZsdstr011New.getVsbed()));
            item.addElement("Z008").setText(judgeNullOrEmpty(zxjZsdstr011New.getZ008()));
            item.addElement("Z009").setText(judgeNullOrEmpty(zxjZsdstr011New.getZ009()));
            item.addElement("PS_PSP_PNR").setText(judgeNullOrEmpty(zxjZsdstr011New.getPsPspPnr()));
            item.addElement("MATNR").setText(judgeNullOrEmpty(zxjZsdstr011New.getMatnr()));
            item.addElement("KWMENG").setText(judgeNullOrEmpty(zxjZsdstr011New.getKwmeng()));
            item.addElement("WERKS").setText(judgeNullOrEmpty(zxjZsdstr011New.getWerks()));
          //  item.addElement("KBETR").setText(judgeNullOrEmpty(zxjZsdstr011New.getKbetr()));
            item.addElement("KBETR").setText("".equals(judgeNullOrEmpty(zxjZsdstr011New.getKbetr())) ? "" : df.format(zxjZsdstr011New.getKbetr()));
            item.addElement("KDKG1_H").setText(judgeNullOrEmpty(zxjZsdstr011New.getKdkg1H()));
            item.addElement("KSCHA").setText(judgeNullOrEmpty(zxjZsdstr011New.getKscha()));
            item.addElement("PS_PSP_PNR_H").setText(judgeNullOrEmpty(zxjZsdstr011New.getPsPspPnrH()));
            item.addElement("LOEKZ").setText(judgeNullOrEmpty(zxjZsdstr011New.getLoekz()));

            item.addElement("DATUM").setText(judgeNullOrEmpty(DateTimeUtils.dateToStrOrNull(zxjZsdstr011New.getDatum())));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(DateTimeUtils.timeToStr(zxjZsdstr011New.getUzeit())));

        }

        return document.asXML();
    }

    public String getXmlOfFyxt01(List<ZxjMesFyxt01> list) {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement("ROOT");
        for (ZxjMesFyxt01 zxjMesFyxt01 : list) {
            Element item = root.addElement("item");
            DecimalFormat df = new DecimalFormat("0.00");
            item.addElement("VBELN").setText(judgeNullOrEmpty(zxjMesFyxt01.getVbeln()));
            item.addElement("ZDAT_FH").setText(judgeNullOrEmpty(DateTimeUtils.dateToStrOrNull(zxjMesFyxt01.getZdatFh())));
            item.addElement("ID").setText(judgeNullOrEmpty(zxjMesFyxt01.getId()));
            item.addElement("DATUM").setText(judgeNullOrEmpty(DateTimeUtils.dateToStrOrNull(zxjMesFyxt01.getDatum())));
            item.addElement("UZEIT").setText(judgeNullOrEmpty(DateTimeUtils.timeToStr(zxjMesFyxt01.getUzeit())));

        }

        return document.asXML();
    }


}
